feat: add sonatype fields (CM-1308) - #4298
Merged
Merged
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is step 1 of 3 for the Sonatype popularity signal on Maven packages. It adds only the schema foundation — five nullable sonatype_* columns on the packages table — leaving CSV ingestion and the rank_packages() wiring to follow-up PRs. The columns default to NULL ("no Sonatype signal"), which keeps existing npm/pypi/other rows unaffected.
Changes:
- Adds Flyway migration
V1783123200__sonatype_popularity.sql. - Introduces
sonatype_popularity_score,sonatype_rank,sonatype_tier,sonatype_snapshot_at, andsonatype_updated_atas nullable columns (no defaults, no index). - Documents intent inline (only
sonatype_popularity_scorewill feed ranking; rank/tier are display/audit).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
skwowet
pushed a commit
that referenced
this pull request
Jul 3, 2026
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org> Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the schema foundation for the Sonatype popularity signal on Maven packages.
Sonatype could not deliver raw monthly Maven download counts, so instead they provide a popularity score derived from their SCA telemetry — normalized 0–100 per ecosystem, tiered P0–P3. Today the Maven ranking pipeline has no popularity signal at all (only
dependent_countandtransitive_dependent_countfeed criticality), so industry-critical packages that are under-represented as dependency targets in our graph get missed.This PR is step 1 of 3: it only introduces the columns that will hold the Sonatype data. The ingestion script and the ranking-function change land in follow-up PRs:
sonatype_*columns topackages.--file, insert-if-missing, idempotent).sonatype_popularity_scoreintorank_packages()as a 4th signal.Changes
V1783123200__sonatype_popularity.sqladding five columns topackages:sonatype_popularity_score numeric— 0–100, normalized per ecosystem; the only column consumed byrank_packages().sonatype_rank int— rank within the Sonatype list; display/audit only, not consumed by ranking.sonatype_tier text—P0|P1|P2|P3.sonatype_snapshot_at timestamptz— timestamp of the Sonatype snapshot the row came from.sonatype_updated_at timestamptz— timestamp of our last upsert of thesonatype_*fields.DEFAULT— intentional. Existing rows (all non-Maven, plus Maven rows not in Sonatype's list) stayNULL, meaning "no Sonatype signal". This is what lets the follow-up ranking change drop the signal for other ecosystems automatically (ecosystem_signal_total = 0→ excluded), with zero impact on npm/pypi.ADD COLUMN ... NULLwith no default → no table rewrite).Type of change
JIRA ticket
CM-1308
Note
Low Risk
Schema-only, nullable column additions with no behavior or ranking changes in this PR.
Overview
Adds Flyway migration
V1783123200__sonatype_popularity.sqlthat extendspackageswith five nullable Sonatype fields:sonatype_popularity_score,sonatype_rank,sonatype_tier,sonatype_snapshot_at, andsonatype_updated_at.The migration is additive only (
ADD COLUMN IF NOT EXISTS, no defaults, no indexes). Existing rows stayNULLuntil follow-up ingestion andrank_packages()wiring land in later PRs.Reviewed by Cursor Bugbot for commit ec661c7. Bugbot is set up for automated code reviews on this repo. Configure here.